const fileOptions = {
  dataDirectory: '/data/',
  dataFile: 'demo.nc',
  glslDirectory: '/data/glsl/'
}

const defaultParticleSystemOptions = {
  maxParticles: 70 * 70,
  particleHeight: 100.0,
  fadeOpacity: 0.996,
  dropRate: 0.003,
  dropRateBump: 0.01,
  speedFactor: 5.0,
  lineWidth: 4.0
}

class Panel {
  constructor() {
    this.maxParticles = defaultParticleSystemOptions.maxParticles
    this.particleHeight = defaultParticleSystemOptions.particleHeight
    this.fadeOpacity = defaultParticleSystemOptions.fadeOpacity
    this.dropRate = defaultParticleSystemOptions.dropRate
    this.dropRateBump = defaultParticleSystemOptions.dropRateBump
    this.speedFactor = defaultParticleSystemOptions.speedFactor
    this.lineWidth = defaultParticleSystemOptions.lineWidth
  }

  getUserInput() {
    // make sure maxParticles is exactly the square of particlesTextureSize
    const particlesTextureSize = Math.ceil(Math.sqrt(this.maxParticles))
    this.maxParticles = particlesTextureSize * particlesTextureSize

    return {
      particlesTextureSize: particlesTextureSize,
      maxParticles: this.maxParticles,
      particleHeight: this.particleHeight,
      fadeOpacity: this.fadeOpacity,
      dropRate: this.dropRate,
      dropRateBump: this.dropRateBump,
      speedFactor: this.speedFactor,
      lineWidth: this.lineWidth
    }
  }
}
export { fileOptions, defaultParticleSystemOptions, Panel }
